package com.moregold.mvvmlib.entity

import androidx.annotation.Keep

/**
 *  Created by Yang on 2020/12/17 0017 00:06.
 *
 */
@Keep
open class BaseResult<T>(
    var status: Int = -1,
    var msg: String = "",
    var data: T,
    var apiPath: String = "",
    var query: String = "",
    var createdDate: Long = 0,
    var updatedDate: Long = 0
) {

    /**
     * 数据是否正确，默认实现
     */
    open fun dataRight(): Boolean {
        return status == 200 || status == 0
    }

    /**
     * 获取错误信息，默认实现
     */
    open fun getMessage(): String {
        return msg
    }
}